package com.example.mybatisdemo.controllers;

import com.example.core.libs.JSONResult;
import com.example.mybatisdemo.entities.User;
import com.example.mybatisdemo.services.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;
import java.util.List;

@RestController
public class UserController {
    @Autowired
    private UserService userService;

    @RequestMapping("/user/list")
    public JSONResult list() {
        List<User> userList = userService.list();
        return new JSONResult().put("list:", userList);
    }
}
